﻿<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<meta name="format-detection" content="telephone=no" />
		<title>资产列表</title>
		<link rel="stylesheet" href="css/style.css?v=1.0">
		<link rel="stylesheet" href="css/index.css?v=1.0">
		<script src="js/jquery-1.8.3.min.js"></script>
		<script src="js/flexible.js?v=1.0"></script>
		<script src="layer-mobile/layer.js?v=1.0"></script>
	</head>
	<body>
		<header id="header" style="position:fixed; top:0;left:0">
			<div class="back" onclick="closeWin();">
				<img src="image/back.png">
			</div>
			<div class="title">资产详情</div>
		</header>
		<div class="assets" style="padding-top:1.28rem">
			<h3>资产记录</h3>
			<ul class="asste-list">
				
			</ul>
			<p class="asste-more">加载更多</p>
		</div>
	</body>
</html>
<script>
    $(function () {
    
	var index = 1,
		num = 10,
		assetid = getQueryString('assetid');//流水id
	
	more();
	
	$('.asste-more').on('click',function(){//点击加载更多
		index+=1;
		more();
	});
	
	function more(){
		$ajax(
			url+'getCreditDetail.ashx',
			'get',
			{
				assetId:assetid,
				pageIndex:index,
				pageSize:num
			},
			function(data){
				var created = data.data.creditDetailList,
					res = '';
                console.log(created)
				if(created.length > 0){
					for(var i = 0,iL=created.length;i<iL;i++){
						res+='<li><span class="asste-name">'+created[i].shortDescription+'</span><span>'+created[i].createdDateTime+'</span><span class="asste-num">+ '+created[i].credit+'</span></li>'
					}
					$('.asste-list').append(res);
                } else {
					
					layer.open({
						content: '没有更多了',
						skin: 'msg',
						time: 2
					});
				}
			},
			function(data){
                loginRes();
			}
		)
    }
    })
	
</script>